#ifndef RESOURCE_EDITOR_COMMANDS_H
#define RESOURCE_EDITOR_COMMANDS_H

#include <ieditoritem.h>

#include <QtGui/QUndoCommand>

namespace swp
{
class GraphicData;
class SwpEntityGraphicItem;

class ChangeTypeCommand : public QUndoCommand
{
public:
    ChangeTypeCommand(GraphicData* data,
        SwpEntityGraphicItem* previousEntity,
        SwpEntityGraphicItem* newEntity);
    ~ChangeTypeCommand();

    void undo();
    void redo();

private:
    bool m_shouldDeletePrevious;
    bool m_shouldDeleteNew;
    GraphicData* m_data;
    SwpEntityGraphicItem* m_previous;
    SwpEntityGraphicItem* m_new;
    QList<core::ConnectionData> m_connections;

};

} // namespace swp

#endif
